package com.hospital.datasource.config;

import com.hospital.datasource.interceptor.TenantInterceptor;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

import javax.annotation.Resource;

public class WebConfiguration extends WebMvcConfigurationSupport {

    @Resource
    private TenantInterceptor tenantInterceptor;

    @Override
    protected void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(tenantInterceptor).addPathPatterns("/**").excludePathPatterns("/static/**");
        super.addInterceptors(registry);
    }
}
